<template>
  <h1>n的值:{{ n }}</h1>
  <button @click="n++">点我n++</button>
  <h3>此时鼠标的位置x:{{point.x}},y:{{point.y}}</h3>
</template>

<script>
//引入生命周期
import {ref} from "vue";
import usePoint from "@/hooks/usePoint";

export default {
  name: "my-demo",
  //在生命周期 配置于组合式配置同时存在时 优先配置项里面的先执行
  setup() {
    let n = ref(0);
    let point = usePoint();
    return {
      n,
      point
    }
  }
}
</script>

<style scoped>

</style>